/*
                    Button Class Definition
*/

#ifndef BUTTON_H
#define BUTTON_H

#include <stdio.h>
#include "SDL/SDL.h"
#include <string>

// Defines *********************************************************************

// Used in passing an event type to HandleEvents()
#define BTN_MOUSECLICKED 0
#define BTN_MOUSEMOTION 1

//******************************************************************************

#include "../Structs.h"

#include "Widget.h"
#include "Label.h"

using namespace std;

class Button : public Widget
{
      public:
             Button();
             ~Button();

             int Initialise(Point NewPosition, string strText, string strFontPath, int iTextSize, string strFilepath, string strCFilepath, SDL_Color TextColour);
             int Initialise(Point NewPosition, string strText, string strFontPath, int iTextSize, string strFilepath, string strCFilepath, string strDFilepath, SDL_Color TextColour);

             int setImage(string strFilepath);
             int setImage(SDL_Surface *newImage);
             SDL_Surface* getImage();

             virtual int HandleMouseDown(int iMouseX, int iMouseY);
             virtual int HandleMouseUp(int iMouseX, int iMouseY);
             virtual int HandleMouseMotion(int iMouseXREL, int iMouseYREL);
             virtual int BlitToSurface(SDL_Surface *screen);

             virtual int BlitToFrame(SDL_Surface *surface, Point FramePosition);

             void setID(string strNewID);
             string getID();

             void setPosition(Point newPosition);
             void setPosition(double x, double y);
             Point getPosition();

             void setWidth(int iNewWidth);
             int getWidth();

             void setHeight(int iNewHeight);
             int getHeight();

             void setText(const string& strNewText);
             string getText();

      protected:
              SDL_Surface *Image, *ImageClicked, *ImageDisabled;

              Point Position;

              int iWidth, iHeight;

              Label lblButtonText;

              string strText;

              bool bClicked;
};

#endif
